package com.book.config;

import cn.hutool.captcha.CaptchaUtil;
import cn.hutool.captcha.LineCaptcha;
import cn.hutool.core.lang.Snowflake;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import java.util.HashMap;

/**
 * @author SuperYu  2024/6/17
 */
@Configuration
public class MyConfig {

    @Bean
    public LineCaptcha lineCaptcha(){
        //定义图形验证码的长和宽
        return CaptchaUtil.createLineCaptcha(210, 90);
    }

    @Bean
    public Snowflake snowflake(){
        return new Snowflake();
    }

    // 用来暂时代替后面我们要学的，redis(缓存)
    @Bean
    public HashMap<String,String> hashMap(){
        return new HashMap<>(16);
    }

}




















